/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.pay.entity;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.modules.base.entity.cars.Tcar;
import com.jeesite.modules.base.entity.fixedexpense.FixedExpense;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 付款单Entity
 * @author wsm
 * @version 2021-03-16
 */
@Table(name="t_payment_detail", alias="a", columns={
		@Column(name="payment_detail_id", attrName="paymentDetailId", label="付款单明细ID", isPK=true),
		@Column(name="brand", attrName="brand", label="品牌"),
		@Column(name="area", attrName="area", label="版型"),
		@Column(name="model", attrName="model", label="车型"),
		@Column(name="row_number", attrName="rowNumber", label="行号"),
		@Column(name="car_id", attrName="carId", label="车辆"),
		@Column(name="ap_code", attrName="apCode", label="应付单"),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="expense_item", attrName="expenseItem", label="费用项目"),
		@Column(name="ap_amount", attrName="apAmount", label="应付金额", comment="应付金额（人民币）"),
		@Column(name="actual_ap_amount", attrName="actualApAmount", label="实付/核销金额", comment="实付/核销金额（人民币）"),
		@Column(name="remarik", attrName="remarik", label="备注"),
		@Column(name="payment_id", attrName="paymentId.paymentId", label="付款单ID"),
		@Column(name="prepayment_code", attrName="prepaymentCode", label="预付款编号"),
		@Column(name="payment_left", attrName="paymentLeft", label="剩余应付金额"),
		@Column(name="prepayment_balance", attrName="prepaymentBalance", label="预付款余额"),
	},joinTable= {
		@JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = Tcar.class, attrName = "tcar", alias = "b",
				on = "b.car_id = a.car_id", columns = {
				@Column(name = "car_id", label = "车辆id", isPK = true),
				@Column(name = "car_name", label = "车辆名称"),
		}),
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= FixedExpense.class, attrName="fixedExpense", alias="c",
				on="c.fixed_expense_id = a.expense_item", columns={
				@Column(name="fixed_expense_id", label="类型id", isPK=true),
				@Column(name="fixed_expense_name", label="类型名称"),
		}),
}, orderBy="a.payment_detail_id ASC"
)
public class TpaymentDetail extends DataEntity<TpaymentDetail> {

	private static final long serialVersionUID = 1L;
	private String paymentDetailId;		// 付款单明细ID
	private String brand;		// 品牌
	private String area;		// 版型
	private String model;		// 车型
	private String carId;		// 车辆
	private String frameNumber;		// 车架号
	private String expenseItem;		// 费用项目
	private Double apAmount;		// 应付金额（人民币）
	private Double payentLeft;		// 剩余应付金额（人民币）
	private Double actualApAmount;		// 实付/核销金额（人民币）
	private String remarik;		// 备注
	private Tpayment paymentId;		// 付款单ID 父类
	private String prepaymentCode;		// 预付款编号
	private String prepaymentCode1;		// 预付款编号
	private Double prepaymentBalance;		// 预付款余额
	private String apCode;		// 应付单
	private String expenseItemName;
	private Long rowNumber;//行号
	private Tcar tcar;
	private FixedExpense fixedExpense;
	private String carName;
	private String paymentCode;

	public String getPrepaymentCode1() {
		return prepaymentCode1;
	}

	public void setPrepaymentCode1(String prepaymentCode1) {
		this.prepaymentCode1 = prepaymentCode1;
	}

	public FixedExpense getFixedExpense() {
		return fixedExpense;
	}

	public void setFixedExpense(FixedExpense fixedExpense) {
		this.fixedExpense = fixedExpense;
	}

	public Tcar getTcar() {
		return tcar;
	}

	public void setTcar(Tcar tcar) {
		this.tcar = tcar;
	}

	public Long getRowNumber() {
		return rowNumber;
	}

	public void setRowNumber(Long rowNumber) {
		this.rowNumber = rowNumber;
	}

	public String getExpenseItemName() {
		return expenseItemName;
	}

	public void setExpenseItemName(String expenseItemName) {
		this.expenseItemName = expenseItemName;
	}

	public String getApCode() {
		return apCode;
	}

	public void setApCode(String apCode) {
		this.apCode = apCode;
	}

	public TpaymentDetail() {
		this(null);
	}

	public Double getPayentLeft() {
		return payentLeft;
	}

	public void setPayentLeft(Double payentLeft) {
		this.payentLeft = payentLeft;
	}

	public TpaymentDetail(Tpayment paymentId){
		this.paymentId = paymentId;
	}

	public String getPaymentDetailId() {
		return paymentDetailId;
	}

	public void setPaymentDetailId(String paymentDetailId) {
		this.paymentDetailId = paymentDetailId;
	}

	@Length(min=0, max=2, message="品牌长度不能超过 2 个字符")
	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	@Length(min=0, max=64, message="版型长度不能超过 64 个字符")
	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	@Length(min=0, max=100, message="车型长度不能超过 100 个字符")
	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	@Length(min=0, max=64, message="车辆长度不能超过 64 个字符")
	public String getCarId() {
		return carId;
	}

	public void setCarId(String carId) {
		this.carId = carId;
	}

	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}

	@Length(min=0, max=100, message="费用项目长度不能超过 100 个字符")
	public String getExpenseItem() {
		return expenseItem;
	}

	public void setExpenseItem(String expenseItem) {
		this.expenseItem = expenseItem;
	}

	public Double getApAmount() {
		return apAmount;
	}

	public void setApAmount(Double apAmount) {
		this.apAmount = apAmount;
	}

	public Double getActualApAmount() {
		return actualApAmount;
	}

	public void setActualApAmount(Double actualApAmount) {
		this.actualApAmount = actualApAmount;
	}

	@Length(min=0, max=255, message="备注长度不能超过 255 个字符")
	public String getRemarik() {
		return remarik;
	}

	public void setRemarik(String remarik) {
		this.remarik = remarik;
	}

	@Length(min=0, max=64, message="付款单ID长度不能超过 64 个字符")
	public Tpayment getPaymentId() {
		return paymentId;
	}

	public void setPaymentId(Tpayment paymentId) {
		this.paymentId = paymentId;
	}

	@Length(min=0, max=100, message="预付款编号长度不能超过 100 个字符")
	public String getPrepaymentCode() {
		return prepaymentCode;
	}

	public void setPrepaymentCode(String prepaymentCode) {
		this.prepaymentCode = prepaymentCode;
	}

	public Double getPrepaymentBalance() {
		return prepaymentBalance;
	}

	public void setPrepaymentBalance(Double prepaymentBalance) {
		this.prepaymentBalance = prepaymentBalance;
	}

	public String getCarName() {
		return carName;
	}

	public void setCarName(String carName) {
		this.carName = carName;
	}

	public String getPaymentCode() {
		return paymentCode;
	}

	public void setPaymentCode(String paymentCode) {
		this.paymentCode = paymentCode;
	}
}
